﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Altairis.FluffyCloud.Data {
    public abstract class AclEntry {

        [Key]
        public Guid AclEntryId { get; set; }

        [Required]
        public string RoleName { get; set; }
        public virtual Role Role { get; set; }

        [Required, MaxLength(20)]
        public string Operation { get; set; }

        public abstract string OperationDisplayName { get; }
        
        [Required]
        public bool Action { get; set; }

        public string ActionDisplayName {
            get {
                return this.Action ? "povolit" : "zakázat";
            }
        }

        public AclEntry() {
            this.AclEntryId = Guid.NewGuid();
        }

    }
}
